<!DOCTYPE html> 
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0, user-scalable=0" name="viewport" />        
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" /> 
<meta content="telephone=no" name="format-detection" /> 
<title>申请解约</title>
<link rel="stylesheet" href="css/search.css">
</head>
<body>
<div class="container">
	<div class="top">
		<div class="inner">
			<img src="images/search-icon.png" alt="">
			<input type="text" placeholder="请输入产品名称">
		</div>
	</div>
	<div class="results">
		<div class="result">股神在这</div>
		<div class="result">我就是股神</div>
		<div class="result">股神007</div>
		<div class="result">我就是股神</div>
	</div>

	<div class="h-wrap">
		<div class="title">最近搜索</div>
		<div class="history">
			<span>我就是股神2</span>
			<i><img src="images/delete-icon.png" alt=""></i>
		</div>
		<div class="history">
			<span>我就是股神3</span>
			<i><img src="images/delete-icon.png" alt=""></i>
		</div>
		<div class="history">
			<span>我就是股神4</span>
			<i><img src="images/delete-icon.png" alt=""></i>
		</div>
	</div>

	<div class="empty">
		<img src="images/info_icon@2x.png" alt="">
		<p>
			无匹配结果<br>
			试试别的关键词吧
		</p>
	</div>

</div>
<script src="js/build/lib.js" type="text/javascript"></script>
<script>
var search= {
	init: function(){
		// 兼容按压效果
		document.body.addEventListener('touchstart', function () { //...空函数即可
		});
	},
	events: function(){
		$('.h-wrap').delegate('.history i','touchend',function(){
			$(this).parent().remove();
		});

		$('.top input[type="text"]').on('input',function(){
			var _val = $.trim($(this).val());
			// $.ajax({
			// 	url: '',
			// 	type:'POST',
			// 	data:{searchVal:_val},
			// 	success: function(data) {
					// 如果找到结果 需要把返回的结果组成结点放到results里面

					// 数据库找不到相应的结果
					$('.empty').show();
			// 	}
			// });

		});

		
	},
	run: function(){
		this.init();
		this.events();
	}
};
search.run();
</script>
</body>
</html>